package example.com.zcq.mymj.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import example.com.zcq.mymj.R;
import example.com.zcq.mymj.ui.CountDownTimerUtils;

public class RegisterActivity extends AppCompatActivity implements View.OnClickListener {

    private EditText mEdtPhone;
    /**
     * 手机验证码
     */
    private TextView mTvCode;
    private EditText mEdtCode;
    /**
     * 获取验证码
     */
    private Button mCountDownButton;
    private EditText mEdtNewPassword;
    /**
     * 确定
     */
    private Button mBtnConfirm;
    private CountDownTimerUtils mCountDownTimerUtils;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        initView();
        //验证码倒计时工具
        mCountDownTimerUtils = new CountDownTimerUtils(mCountDownButton, 60000, 1000);
    }

    private void initView() {
        mEdtPhone = (EditText) findViewById(R.id.edt_phone);
        mTvCode = (TextView) findViewById(R.id.tv_code);
        mEdtCode = (EditText) findViewById(R.id.edt_code);
        mCountDownButton = (Button) findViewById(R.id.count_down_button);
        mCountDownButton.setOnClickListener(this);
        mEdtNewPassword = (EditText) findViewById(R.id.edt_new_password);
        mBtnConfirm = (Button) findViewById(R.id.btn_confirm);
        mBtnConfirm.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            default:
                break;
            case R.id.count_down_button:
                mCountDownTimerUtils.start();
                break;
            case R.id.btn_confirm:
                break;
        }
    }
}
